package redteam.grabthegreen;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;

public class SetupWindow extends Activity {
	@Override
    public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.setupwindow);
		TextView gameNameTextView = (TextView)findViewById(R.id.gamenametextview);
		gameNameTextView.setText("Game Name:");
		EditText gameNameEditText = (EditText)findViewById(R.id.gamenameedittext);
		TextView gameTypeTextView = (TextView)findViewById(R.id.gametypetextview);
		gameTypeTextView.setText("Game Type:");
		Spinner gameTypeSpinner = (Spinner)findViewById(R.id.gametypespinner);

        ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.gametypes, android.R.layout.simple_spinner_item);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        gameTypeSpinner.setAdapter(adapter);

		Button createGameButton = (Button)findViewById(R.id.setboundaries);
		createGameButton.setText("Set Boundaries");
		createGameButton.setOnClickListener(new Button.OnClickListener() {
        	public void onClick(View v) {
        		startSubActivity(new Intent(SetupWindow.this, SetBoundsWindow.class), 0);
        	}
        });
		Button quitButton = (Button)findViewById(R.id.findplayers);
		quitButton.setText("Find Players");
		quitButton.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				startSubActivity(new Intent(SetupWindow.this, InvitePlayersWindow.class), 0);
			}
		});

	}
}
